<html>
<head>
	<script src="../js/dojo/dojo.js"></script>
	<script src="../js/dair/Aliases.js"></script>
	<script type="text/javascript">
		dojo.require("dair.Window");
		dojo.addOnLoad(function(){
		
			var test = new dair.Window({
				href: "app:/tests/WindowData.html",
				size:{
					w:"5%", h:"100%"
				},
				alwaysInFront:true
			});
		
			var winder = new dair.Window({
				href: "app:/tests/WindowData.html",
				size:{
					w: 300, h: 300, t:50, l:50
				},
				type:"lightweight"
			});
			
			var otherWinder = new dair.Window({
				href: "http://sitepen.com/",
				size: {
					w: "50%", h: "50%", l:100
				},
				type:"utility"
			});
			otherWinder.center();
			
			
			var transparent = new dair.Window({
				href: "app:/tests/WindowData.html",
				size: {
					w: 100, h:100, l:1300, t:200
				},
				transparent:true
			});
			
			transparent.attr("alwaysInFront", true);
			setTimeout(function(){
				air.trace('moving to back again');
				transparent.attr("alwaysInFront", false);
				winder.bringToFront().activate();
				
				air.trace('resizing sitepen.com pane');
				otherWinder.attr("position", {
					h:"100%", w:"100%"
				});
				otherWinder.notify("Full Screened");
				otherWinder.attr("position", {
					h:200, w:400
				})
				
			}, 5000);
			
			var unclosable = new dair.Window({
				onClose: function(e){
					e && e.preventDefault(); // you have to do both, but dojo connect doesn't pass E
					return false; 
				},
				size: {
					w: 100, h:100
				},
				href:"app:/tests/WindowData.html"
			});
			
			var tester = null;
			dojo.connect(dojo.byId("newWindow"),"onclick", function(){
				air.trace('clicked'); 
				if(tester) return;
				tester = new dair.Window({
					size: { w:100, h:100 }
				});
				dair.resizeWindow({
					pane: tester,
					duration:2000,
					width:"300",
					height:"300"
				}).play();
			});
			
		});
	</script>
</head>
<body>
	<h1>Sample</h1>
	<button id="newWindow">
		animate
	</button>
</body>
</html>